package cn.zzu.faceorgans;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import cn.zzu.faceorgans.faceAPI.FaceDetect;
import cn.zzu.faceorgans.faceAPI.FaceLandmark;
import cn.zzu.faceorgans.utils.GetToken;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        testBaiduAPI();
        Button toFaceButton = findViewById(R.id.to_face_activity);
        toFaceButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, TestActivity4.class);
                startActivity(intent);
            }
        });
    }
    // 该方法测试百度API
    private void testBaiduAPI(){
        MyThread myThread = new MyThread();
        myThread.start();
    }


    class MyThread extends Thread{
        @Override
        public void run() {
            System.out.println("token: " + GetToken.getAuth());
//          FaceDetect.faceDetect();

            FaceLandmark.faceLandmark();

        }
    }
}